package com.example.dao.authMapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.pojo.LoginUser;
import org.apache.ibatis.annotations.*;

import java.util.Date;
import java.util.Map;

@Mapper
public interface  UserMapper extends BaseMapper<LoginUser> {

    @Insert("insert into t_gps_verifIcation_code(random_number_id,random_num,inserttime)values(#{ranId},#{ran},#{datetime})")
    void insertVerifIcationCode(@Param("ranId") String ranId, @Param("ran") String ran, @Param("datetime")Date datetime);

    @Select("select * from t_gps_verifIcation_code where random_number_id =#{rid}")
    Map<String, Object> selectVerifIcationCode(@Param("rid") String rid);

    @Delete("delete from oauth_refresh_token where token_id in (select refresh_token from oauth_access_token where user_name =#{username})")
    void deleteReshToken(@Param("username") String username);
@Delete("delete from oauth_access_token where  user_name =#{username}")
    void deleteToken(@Param("username")String username);

@Delete("delete from t_gps_verifIcation_code where random_number_id =#{rid}")
    void deleteYzm(@Param("rid") String rid);
}
